Add git-remote-p2p-annex and git-remote-tor-annex to standalone builds
authorJoey Hess <joeyh@joeyh.name>
Mon, 22 Sep 2025 14:20:36 +0000 (10:20 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 22 Sep 2025 14:20:36 +0000 (10:20 -0400)
Build/Standalone.hs
CHANGELOG
doc/bugs/git-remote-p2p-annex_missing_in_standalone_build.mdwn
standalone/linux/skel/git-remote-p2p-annex [new file with mode: 0755]
standalone/linux/skel/git-remote-tor-annex [new file with mode: 0755]
standalone/osx/git-annex.app/Contents/MacOS/git-remote-p2p-annex [new file with mode: 0755]
standalone/osx/git-annex.app/Contents/MacOS/git-remote-tor-annex [new file with mode: 0755]

index 44e817170744e3efe9f4cefff9aa9b25019242f5..b98fcaaf666ef69c3c0d473ecb660945b9f4de4b 100644 (file)
@@ -221,6 +221,8 @@ installGitAnnex topdir = go (topdir </> literalOsPath "bin")
                        error "cp failed"
                unlessM (boolSystem "strip" [File (fromOsPath (bindir </> literalOsPath "git-annex"))]) $
                        error "strip failed"
+               -- Note that when adding more commands here, wrapper
+               -- scripts also need to be added in standalone/
                createSymbolicLink "git-annex" (fromOsPath (bindir </> literalOsPath "git-annex-shell"))
                createSymbolicLink "git-annex" (fromOsPath (bindir </> literalOsPath "git-remote-p2p-annex"))
                createSymbolicLink "git-annex" (fromOsPath (bindir </> literalOsPath "git-remote-tor-annex"))
index fe989c47c58256f2f81d06251df7f097cc31dd39..acb06c4485b87b81d0d6298ac1154e5c5fd01080 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -18,6 +18,7 @@ git-annex (10.20250829) UNRELEASED; urgency=medium
   * p2phttp: Fix a hang that could occur when used with --directory,
     and a repository in the directory got removed.
   * Added annex.assistant.allowunlocked config.
+  * Add git-remote-p2p-annex and git-remote-tor-annex to standalone builds.
 
  -- Joey Hess <id@joeyh.name>  Fri, 29 Aug 2025 12:34:06 -0400
 
index 8733ffee3c16ba999100a76139fd727876025919..7a500ce63f429f78e3c965b4430e32416f1c0eef 100644 (file)
@@ -25,4 +25,4 @@ Try to use git-remote-p2p-annex from the latest standalone build.
 
 ### Have you had any luck using git-annex before? (Sometimes we get tired of reading bug reports all day and a lil' positive end note does wonders)
 
-
+> [[fixed|done]] --[[Joey]]
diff --git a/standalone/linux/skel/git-remote-p2p-annex b/standalone/linux/skel/git-remote-p2p-annex
new file mode 100755 (executable)
index 0000000..8414df0
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
+if [ -n "$link" ]; then
+       base="$(dirname "$link")"
+else
+       base="$(dirname "$0")"
+fi
+
+if [ ! -d "$base" ]; then
+       echo "** cannot find base directory (I seem to be $0)" >&2
+       exit 1
+fi
+if [ ! -e "$base/runshell" ]; then
+       echo "** cannot find $base/runshell" >&2
+       exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+exec "$base/runshell" git-remote-p2p-annex "$@"
diff --git a/standalone/linux/skel/git-remote-tor-annex b/standalone/linux/skel/git-remote-tor-annex
new file mode 100755 (executable)
index 0000000..a9e722e
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh
+link="$(readlink -f "$0" 2>/dev/null || readlink "$0")" || true
+if [ -n "$link" ]; then
+       base="$(dirname "$link")"
+else
+       base="$(dirname "$0")"
+fi
+
+if [ ! -d "$base" ]; then
+       echo "** cannot find base directory (I seem to be $0)" >&2
+       exit 1
+fi
+if [ ! -e "$base/runshell" ]; then
+       echo "** cannot find $base/runshell" >&2
+       exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+exec "$base/runshell" git-remote-tor-annex "$@"
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/git-remote-p2p-annex b/standalone/osx/git-annex.app/Contents/MacOS/git-remote-p2p-annex
new file mode 100755 (executable)
index 0000000..d498b4b
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+link="$(readlink "$0")" || true
+if [ -n "$link" ]; then
+       base="$(dirname "$link")"
+else
+       base="$(dirname "$0")"
+fi
+
+if [ ! -d "$base" ]; then
+       echo "** cannot find base directory (I seem to be $0)" >&2
+       exit 1
+fi
+if [ ! -e "$base/runshell" ]; then
+       echo "** cannot find $base/runshell" >&2
+       exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+# If this is a standalone app, set a variable that git-annex can use to
+# install itself.
+if [ -e "$base/git-annex" ]; then
+       GIT_ANNEX_APP_BASE="$base"
+       export GIT_ANNEX_APP_BASE
+fi
+
+exec "$base/runshell" git-remote-p2p-annex "$@"
diff --git a/standalone/osx/git-annex.app/Contents/MacOS/git-remote-tor-annex b/standalone/osx/git-annex.app/Contents/MacOS/git-remote-tor-annex
new file mode 100755 (executable)
index 0000000..2a8061d
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+link="$(readlink "$0")" || true
+if [ -n "$link" ]; then
+       base="$(dirname "$link")"
+else
+       base="$(dirname "$0")"
+fi
+
+if [ ! -d "$base" ]; then
+       echo "** cannot find base directory (I seem to be $0)" >&2
+       exit 1
+fi
+if [ ! -e "$base/runshell" ]; then
+       echo "** cannot find $base/runshell" >&2
+       exit 1
+fi
+
+# Get absolute path to base, to avoid breakage when things change directories.
+orig="$(pwd)"
+cd "$base"
+base="$(pwd)"
+cd "$orig"
+
+# If this is a standalone app, set a variable that git-annex can use to
+# install itself.
+if [ -e "$base/git-annex" ]; then
+       GIT_ANNEX_APP_BASE="$base"
+       export GIT_ANNEX_APP_BASE
+fi
+
+exec "$base/runshell" git-remote-tor-annex "$@"